package com.itheima.arithmeticoperator;
//导包
import java.util.Scanner;

public class ArithmeticoperatorDemo1 {
    //主入口
    public static void main(String[] args) {
        //1. 键盘录入
        System.out.println("请输入一个三位数: ");
        Scanner sc = new Scanner(System.in);
        //2. 获取个位,十位,百位
        //公式:
        //个位: 数字 % 10
        //十位: 数字 / 10 % 10
        //百位: 数字 /100 % 10
        //千位: ...
        //...
        int num = sc.nextInt();
        int a = num % 10;
        int b = num / 10 % 10;
        int c = num /100 % 10;
        System.out.println("个位数为: " + a);
        System.out.println("十位数为: " + b);
        System.out.println("百位数为: " + c);
    }
}
